const splitter2 = document.getElementById('splitter');
const topPane = document.querySelector('.topPanel');
const bottomPane = document.getElementById('bottomPane');
let isDragging2 = false;

splitter2.addEventListener('mousedown', function (e) {
    isDragging2 = true;
    document.body.style.cursor = 'row-resize';
    document.body.style.userSelect = 'none';
});

document.addEventListener('mousemove', function (e) {
    if (!isDragging2) return;

    const containerRect = topPane.parentElement.getBoundingClientRect();
    const offset = e.clientY - containerRect.top;
    const topHeight = Math.min(Math.max(offset, 100), containerRect.height - 100);

    console.log(e.pageY)
    topPane.style.height = e.pageY + 'px';
});

document.addEventListener('mouseup', function () {
    if (isDragging2) {
        isDragging2 = false;
        document.body.style.cursor = 'default';
        document.body.style.userSelect = '';
    }
});